count element occurence in python